package me.itsoo.artemis.framework.core.util;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

/**
 * NumberUtils
 *
 * @author zxy
 * @version 0.0.1
 * @since 2023/5/18
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class NumberUtils {

    public static int parseInt(String val) {
        return parseInt(val, 0);
    }

    public static int parseInt(String val, int defaultVal) {
        try {
            return Integer.parseInt(val);
        } catch (NumberFormatException e) {
            return defaultVal;
        }
    }
}
